home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / doorinfo.zip / STRUCTS.H < prev    next >
C/C++ Source or Header  |  1997-05-14  |  11KB  |  348 lines

  1. /*
  2. ** This file defines common structures used by the INFO*SHARE
  3. ** message system.  These structures define file formats, user
  4. ** accounting information, and other items.
  5. **
  6. */
  7.  
  8. #ifndef STRUCTS_DEF
  9.  
  10. #define STRUCTS_DEF
  11.  
  12. #define IDLETIME 20         /* minutes for idle timer */
  13.  
  14. #define uidlen 32
  15. #define outbufsiz 10240
  16. #define ibufsz 2048                /* should need 1024 at most, but give some
  17.                                  * space */
  18.  
  19. struct acct_rec
  20. {
  21.     char acctname[uidlen];        /* user name - null until it is claimed */
  22.     char realname[uidlen];        /* user's REAL name */
  23.     char street[32];            /* billing address */
  24.     char city[22];
  25.     char state[16];
  26.     char zip[12];
  27.     char phone[16];                /* billing phone number             */
  28.     char pword[12];                /* user - supplied password */
  29.     char compter;                /* single character computer type */
  30.     char linfed;                /* y=line feed reqd, n=not reqd */
  31.     unsigned log_date;            /* date/time of last logon     */
  32.     unsigned log_time;
  33.     unsigned creat_date;        /* date account was created */
  34.     unsigned expire_date;        /* date account expires */
  35.     unsigned birthday;            /* date field for birthday */
  36.     unsigned linlen;            /* number of bytes per screen line */
  37.     unsigned dloads;            /* number of files downloaded */
  38.     unsigned long logons;        /* number of logons this month */
  39.     unsigned long totlogons;    /* total number of logons */
  40.     unsigned long acctime;        /* total minutes of connect time this month */
  41.     unsigned long totacctime;    /* total minutes of connect time */
  42.     unsigned acmsgdate[2];        /* date/time of last message read  */
  43.     char setupques[6][40];      /* answers to sysop-specific questions  */
  44.     int new_flag;               /* set to 1 when account created. */
  45.     long uploadflags[2];
  46.     int use_credits;            /* 1 if credit user, 0 if timed user */
  47.     int priv_level;                /* this is the privilege level. */
  48.     /* system, unrestricted, restricted */
  49.     int verbose;                /* 1 = verbose, 0 = short */
  50.     unsigned long tlcf_time;
  51.     long msgskipflags[2];
  52.     long msgreadflags[2];
  53.     long msgpostflags[2];
  54.     long dloadflags[2];
  55.     long accessflags;
  56.     unsigned uploads;
  57.     char acctnum[10];            /* account number - optional */
  58.     char a_comment[30];
  59.     int dayacctime;             /* how long has he been online today? */
  60.     int sex;                    /* 1 = male, 0 = female */
  61.     unsigned long bulreadtime;    /* date/time of last time bulletins read */
  62.     unsigned AUTO1_date;        /* reserved fields! */
  63.     unsigned AUTO1_time;        /* do not disturb! */
  64.     unsigned prev_logdate;
  65.     unsigned prev_logtime;        /* date and time of previous log on */
  66.     char wphone[16];
  67.     int lines_per_page;            /* normally 24 */
  68.     int protocol;                /* users preferred protocol */
  69.     unsigned long upload_k;        /* kbytes uploaded */
  70.     unsigned long download_k;    /* kbytes downloaded */
  71.     long credits;                /* credits this guy has */
  72.     unsigned int logoff_date;
  73.     unsigned int logoff_time;
  74.     unsigned int prev_logoff_date;
  75.     unsigned int prev_logoff_time;
  76.     int account_type;
  77.     char unused_space_2[14];    /* for future expansion */
  78. };
  79.  
  80. #define priv_system     5
  81. #define priv_sysop      4
  82. #define priv_unrestricted 3
  83. #define priv_demo       2
  84. #define non_paying      1
  85. #define priv_restricted 0
  86.  
  87. #define userbioaccess   1L
  88. #define tlcf_access     2L
  89. #define postemailaccess 4L
  90. #define filessaccess    8L
  91. #define subopaccess     16L
  92. #define sysopaccess     32L
  93. #define networkaccess   64L
  94. #define submenuaccess   128L
  95. #define submenu2access  256L
  96. #define submenu3access  512L
  97. #define submenu4access  1024L
  98. #define submenu5access  2048L
  99. #define sendallowed     4096L
  100. #define stealthallowed  8192L
  101. #define num_access_flags 14
  102.  
  103. /* the next structure is used by the software to manage
  104.    each account while the user is on-line.
  105.    current menu information and other pertinent information
  106.    is kept in this structure.
  107. */
  108.  
  109. struct user_rec
  110. {
  111.     int u_stat;                    /* primary state - indicates current
  112.                                  * subsystem */
  113.     int u_stat2;                /* sub-state - function within subsystem */
  114.     int u_eltime;                /* elapsed time from logon */
  115.     unsigned int u_work1;        /* general purpose work variable */
  116.     unsigned int u_work2;        /* general purpose work variable */
  117.     int u_btusts;                /* current breakthru status */
  118.     int u_paged;                /* user paged flag */
  119.     int u_prflvl;                /* profanity level */
  120.     int visitor;                /* is this just a visitor ? */
  121.     int u_ansi;                    /* 1 =supports ansi graphics, 0 = not */
  122.     int u_idletime;                /* the amount of time to allow this user 2b
  123.                                  * idle, in minutes */
  124.     int door_inq;                /* doors input queue number    user->door */
  125.     int door_outq;                /* doors output queue number   door->user */
  126.     char doors_id[10];            /* doors program ID string */
  127.     int u_doortcb;
  128.     int u_privateflag;
  129.     int u_timeroff;                /* activity timer disabled ? */
  130.     unsigned int u_ticker;        /* 1-second ticker for user programs */
  131.     int u_work3;                /* used by editor */
  132.     int u_curmenu;                /* menu number for return in main menu */
  133.     int connecttimer;            /* how many mins left on this call */
  134.     int idletimer;
  135.     int bgrdflag;                /* this guy performing bgrd xfers? */
  136.     int current_cost;            /* credits per minute for current activity */
  137.     unsigned baudrate;
  138.     int time_left_today;        /* how many minutes left for the day ? */
  139.     int time_on_thiscall;        /* how many minutes he's been online */
  140.     int stealth;
  141.     unsigned char ignore[9]; /* one bit for each line, if non-0 then */
  142.                             /* the corresponding line is being ignored */
  143.     unsigned char gag;   /* if non-0, user is gagged, cannot .send or */
  144.                             /* talk in tlcf. */
  145.     unsigned int insysopchat;
  146.     unsigned int chatwith;
  147.     int busyflag;           /* for turning off .sends */
  148.     int u_flushtimer;       /* used to save acct info to disk */
  149.     char unused_u_space[18];    /* for future expansion, so doors won't
  150.                                  * change */
  151. };
  152.  
  153. #define vbsmsg 1
  154. #define shortmsg 0
  155.  
  156. struct timestamp
  157. {
  158.     unsigned ts_date;            /* bit fields for date */
  159.     unsigned ts_time;            /* bit fields for time */
  160.     int ts_year;
  161.     int ts_month;
  162.     int ts_day;
  163.     int ts_hour;
  164.     int ts_minute;
  165.     char ts_str[15];
  166. };
  167.  
  168. #define EMBUFSIZE 8192
  169.  
  170. struct em_rec
  171. {
  172.     char em_acct[uidlen];        /* addressee */
  173.     char em_origid[uidlen];        /* sender's id */
  174.     char em_subject[40];        /* email subject */
  175.     char em_filename[14];        /* for attached files */
  176.     unsigned em_date;
  177.     unsigned em_time;
  178.     int em_new;                    /* 1 if this is new message */
  179.     char em_msg[EMBUFSIZE];          /* 100 lines, 80 chars (approx) */
  180. };
  181.  
  182. struct u_em_rec
  183. {
  184.     char addr[uidlen];
  185.     unsigned long cur_pos;
  186.     int readnew;
  187.     char cur_list[20];
  188.     char subject[40];
  189.     char fname[14];
  190.     int pos_list_count;
  191.     int list_indx;
  192.     int receipt;                /* return receipt requested ? */
  193. };
  194.  
  195. struct mail_list_rec
  196. {
  197.     char owner_id[uidlen];
  198.     char listname[20];
  199.     int entrycount;
  200.     char list_entry[64][32];
  201. };
  202.  
  203. /*
  204. ** Record structure for download file listings.
  205. */
  206.  
  207. #define DLREC_TEXT_SIZE 1200
  208.  
  209. struct dloadrec
  210. {
  211.     struct dload_header
  212.     {
  213.         unsigned dl_btype;          /* library number */
  214.         unsigned dl_cat;            /* category */
  215.         char dl_name[14];           /* full name, spaces allowed */
  216.         long int dl_filesize;       /* file size */
  217.         char dl_acctid[32];         /* who uploaded it */
  218.         unsigned dl_date;           /* when was it uploaded */
  219.         unsigned dl_lastdl;         /* last time it was downloaded */
  220.         unsigned dl_count;          /* how many times it was dloaded */
  221.         char dl_password[8];        /* password for file, if req'd */
  222.     } dload_hdr;
  223.     char dl_info[DLREC_TEXT_SIZE];  /* variable text to describe file */
  224.  
  225. };
  226.  
  227.  
  228. struct windows
  229. {
  230.     char w_name[20];
  231.     int x_max;
  232.     int y_max;
  233.     int last_x;
  234.     int x_pos;
  235.     int y_pos;
  236. };
  237.  
  238. #define maxresp 100
  239. #define msg_fixed_size 70
  240. #define msg_resp_size  40
  241.  
  242. struct msg_record
  243. {
  244.     unsigned msgfolder;
  245.     unsigned msgnum;
  246.     unsigned last_update[2];
  247.     char subject[60];
  248.     unsigned respcnt;
  249.     struct resp_rec
  250.     {
  251.         char orig_id[uidlen];
  252.         unsigned post_time[2];
  253.         unsigned long msgsequence;    /* uniquely identifies text */
  254.     }   resp[maxresp];
  255. };
  256.  
  257. #define xascii 0
  258. #define xmodem 1
  259. #define ACK 06
  260. #define EOT 04
  261. #define NAK 21
  262. #define SOH 01
  263. #define CAN 24
  264. #define STX 02
  265.  
  266. /*
  267. ** The flags are defined as follows -
  268. **   bit  0   is eot-sent flag
  269. **   bit  1   is file-open flag
  270. */
  271.  
  272. #define eot_sent 1
  273. #define crcflag  2
  274. #define file_open 4
  275. #define sendcflag 8
  276. #define ymodemflag 16
  277. #define no_save -1
  278.  
  279. typedef int (*faddr) ();        /* function address */
  280.  
  281. struct xfer_rec
  282. {
  283.     int xf_state;
  284.     int xf_count;
  285.     long xf_totsize;
  286.     int xf_protocol;
  287.     faddr xf_ulcompfunc;        /* function to execute when upload done */
  288.     int bye_when_done;
  289.     char xf_name[40];
  290.     char xf_xkwd[4][16];        /* keywords to use in search */
  291. };
  292.  
  293. #define FALSE 0
  294. #define TRUE 1
  295.  
  296. /*
  297. ** State definitions for infoshare programs.
  298. */
  299.  
  300. #define st_idle           0        /* line not active */
  301. #define st_logon          1        /* ring detected, user logging on */
  302. #define st_newacct        2        /* new account processing */
  303. #define st_main           3        /* main menu has been shown */
  304. #define st_tlcf           4     /* teleconferencing */
  305. #define st_userlist       5     /* user list                */
  306. #define st_extern         6        /* executing a 'doors' program   */
  307. #define st_logoff         7     /* user is receiving logoff message */
  308. #define st_exitting       8     /* logging off */
  309. #define st_system         9     /* system users menu */
  310. #define st_system_disp   10     /* displaying user info */
  311. #define st_system_edit   11     /* editting a user account */
  312. #define st_oocredits     12     /* out of credits... leave feedback ? */
  313. #define st_network       26     /* a second port for a door */
  314.  
  315. /*
  316. ** Operator (system console) state definitions
  317. */
  318.  
  319. #define opr_st_idle    0
  320. #define opr_st_quit    1
  321. #define opr_st_sendmenu   2
  322. #define opr_st_send    3
  323. #define opr_st_brcast  4
  324. #define opr_st_monitor 5
  325. #define opr_st_util    6
  326. #define opr_st_fback   7
  327. #define opr_st_hangup  8
  328. #define opr_st_tlcf    9
  329.  
  330. #define opr_st_send2   10
  331. #define opr_st_tlcf2   11
  332.  
  333. #define opr_st_showtlcf 12
  334. #define opr_st_sim0 13            /* simulating channel 0 */
  335. #define opr_st_sim1 14
  336. #define opr_st_acctdel 15
  337. #define opr_st_acctmyn 16
  338.  
  339. #define opr_st_acctedit  17
  340. #define opr_st_record    18
  341. #define opr_st_util3     19
  342. #define opr_st_chat1     20
  343. #define opr_st_chat2     21
  344.  
  345. #endif
  346.  
  347.  
  348.